import { Redirect } from 'umi';
import React from 'react';

export default (props: any) => {
  const isLogin = localStorage.getItem('user') !== null;
  if (isLogin) {
      return <div>{props.children}</div>;
  }
  return <Redirect to="/login" />;
};
